﻿<Window x:Class="Xinnos.Lca.Yacht.Analyzer.View.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:this="clr-namespace:Xinnos.Lca.Yacht.Analyzer.View" 
        Title="{Binding Title}" Height="360" Width="300" WindowStyle="ToolWindow">
    <Window.Resources>
        <Image x:Key="iconSave" Source="Icons/file_save_as.png" />
        <Image x:Key="iconLoad" Source="Icons/folder_vertical_open.png" />
        <Image x:Key="iconTableRefresh" Source="Icons/table_refresh.png" />
        <Image x:Key="iconChart" Source="Icons/chart_column_up.png" />
        <Image x:Key="iconConfigure" Source="Icons/Control-Panel.png" />
        <Image x:Key="iconInformation" Source="Icons/Information.png" />
        
        <Style x:Key="buttonStyle" TargetType="{x:Type Button}">
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
            <Setter Property="Height" Value="32" />
        </Style>
    </Window.Resources>
    <Window.CommandBindings>
        <CommandBinding Command="SaveAs" CanExecute="OnCanExecuteSaveCommand" Executed="OnExecuteSaveCommand" />
        <CommandBinding Command="Open" CanExecute="OnCanExecuteLoadCommand" Executed="OnExecuteLoadCommand" />
        <CommandBinding Command="Replace" CanExecute="OnCanExecuteConfigureCommand" Executed="OnExecuteConfigureCommand" />
        <CommandBinding Command="Print" CanExecute="OnCanExecuteExportCommand" Executed="OnExecuteExportCommand" />
        <CommandBinding Command="Refresh" CanExecute="OnCanExecuteRefreshCommand" Executed="OnExecuteRefreshCommand" />
        <CommandBinding Command="Properties" CanExecute="OnCanExecuteProfileCommand" Executed="OnExecuteProfileCommand" />
    </Window.CommandBindings>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="30" />
        </Grid.RowDefinitions>
        <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,5,0,5">
            <Button Content="{StaticResource iconSave}" Style="{StaticResource buttonStyle}" ToolTip="저장" Command="SaveAs" />
            <Button Content="{StaticResource iconLoad}" Style="{StaticResource buttonStyle}" ToolTip="불러오기" Command="Open" />
            <Button Content="{StaticResource iconConfigure}" Style="{StaticResource buttonStyle}" ToolTip="설정" Command="Replace" />
            <Button Content="{StaticResource iconTableRefresh}" Style="{StaticResource buttonStyle}" ToolTip="분석 갱신" Command="Refresh" />
            <Button Content="{StaticResource iconInformation}" Style="{StaticResource buttonStyle}" ToolTip="프로그램 정보" Command="Properties" />
        </StackPanel>
        <ListView Grid.Row="1">
            <ListView.Items>
                <ToggleButton Content="WBS" Height="30" IsChecked="{Binding Structure}" />
                <ToggleButton Content="Environmental Profile (Table)" Height="30" IsChecked="{Binding Profile}" />
                <ToggleButton Content="Environmental Profile (Graph)" Height="30" IsChecked="{Binding Pie}" />
                <ToggleButton Content="Components" Height="30" IsChecked="{Binding Component}" />
                <ToggleButton Content="Assessment" Height="30" IsChecked="{Binding Assessment}" />
                <ToggleButton Content="Graph" Height="30" IsChecked="{Binding Graph}" />
                <Button Content="Export" Height="30" Command="Print" />
            </ListView.Items>
            <ListView.ItemContainerStyle>
                <Style TargetType="ListViewItem">
                    <Setter Property="HorizontalContentAlignment" Value="Stretch" />
                </Style>
            </ListView.ItemContainerStyle>
        </ListView>
    </Grid>
</Window>